-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Lang] Load cuSparse and cuSolver library for preparing sparse matrix on GPU #4904
Conversation
✅ Deploy Preview for docsite-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Sorry for the delayed update. Now, the BTW, should we add flags to indicate whether we should load those libraries, like |
Hi @Hanke98, thanks very much.
Maybe we could use another approach. When using the sparse matrix with How do you guys think @k-ye, @strongoier ? |
} | ||
} | ||
|
||
CUSPARSEDriver::CUSPARSEDriver() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd suggest not to do this in the constructor, becuase if the lib fails to load, we get a broken/zombie object. A safer approach could be to load DLL in a function. If that fails, returns the exception/error to Python. Otherwise move that loaded lib into CuSolverDriver
.
Also, we need to make sure not accidentally invoke CUSPARSEDRiver::get_instance()
when we don't need the sparse matrix, otherwise Taichi could be broken if cuSparse is not installed.
I know this is not a newly introduced problem, so this is just something to think about :-)
SG! TBH I was initially thinking something like torch's tags, e.g. |
Related issue = #2906
Start to support sparse matrix on CUDA backend from this pr.
We first load the
cuSparse
andcuSolver
libs via theDynamicLoader
class in this pr.A new class,
CUDADriverBase
is introduced as the base class for the driver classes of these libs, which might also be helpful for the potential libs that we can use in the future.